package API.DAY10.map;

import java.util.HashMap;
import java.util.Map;

public class Test {
    public static void main(String[] args) {
        String line = "Hello world!thinking in java!i love java";
        Map<Character,Integer> map = new HashMap<>();
        for (int i=0;i<line.length();i++){
//            System.out.println(line.charAt(i));
//            System.out.println(map.containsKey(line.charAt(i)));
            if(map.containsKey(line.charAt(i))){
                map.put(line.charAt(i),map.get(line.charAt(i))+1);
            }
            else {
                map.put(line.charAt(i),1);
            }
        }
        System.out.println(map);
    }
}
